<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
    
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
     Yolin
  </title>
  <meta name="generator" content="hexo-theme-yilia-plus">
  
  <link rel="shortcut icon" href="/favicon.png" />
  
  
<link rel="stylesheet" href="/css/style.css">

  
<script src="/js/pace.min.js"></script>


  

  

<link rel="alternate" href="/atom.xml" title="Yolin" type="application/atom+xml">
</head>

</html>

<body>
  <div id="app">
    <main class="content">
      
<section class="cover">
    
  <div class="cover-frame">
    <div class="bg-box">
      <img src="/images/cover2.jpg" alt="image frame" />
    </div>
    <div class="cover-inner text-center text-white">
      <h1><a href="/">Yolin</a></h1>
      <div id="subtitle-box">
        
        <span id="subtitle"></span>
        
      </div>
      <div>
        
      </div>
    </div>
  </div>
  <div class="cover-learn-more">
    <a href="javascript:void(0)" class="anchor"><i class="ri-arrow-down-line"></i></a>
  </div>
</section>



<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js"></script>

<div id="main">
  <section class="outer">
  <article class="articles">
    
    
    
    
    <article id="post-yaml配置注入" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/11/23/yaml%E9%85%8D%E7%BD%AE%E6%B3%A8%E5%85%A5/"
    >yaml配置注入</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/11/23/yaml%E9%85%8D%E7%BD%AE%E6%B3%A8%E5%85%A5/" class="article-date">
  <time datetime="2020-11-23T08:50:02.000Z" itemprop="datePublished">2020-11-23</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Spring-Boot/">Spring Boot</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="yaml注入配置文件"><a href="#yaml注入配置文件" class="headerlink" title="yaml注入配置文件"></a>yaml注入配置文件</h2><h4 id="1-新建yaml配置文件"><a href="#1-新建yaml配置文件" class="headerlink" title="1.  新建yaml配置文件"></a>1.  新建yaml配置文件</h4><p>在Springboot项目中的resources目录下新建一个文件application.yml</p>
<h4 id="2-编写一个实体类Dog"><a href="#2-编写一个实体类Dog" class="headerlink" title="2.  编写一个实体类Dog;"></a>2.  编写一个实体类Dog;</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Component</span>  <span class="comment">//注册bean到容器中</span></span><br><span class="line"><span class="meta">@Data</span></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Dog</span> </span>&#123;</span><br><span class="line">    <span class="keyword">private</span> String name;</span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">int</span> age;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h4 id="3-使用-Value给bean注入属性值"><a href="#3-使用-Value给bean注入属性值" class="headerlink" title="3.  使用@Value给bean注入属性值"></a>3.  使用@Value给bean注入属性值</h4><p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-11-22_21-45-00.jpg" alt=""></p>
      
      <a class="article-more-link" href="/2020/11/23/yaml%E9%85%8D%E7%BD%AE%E6%B3%A8%E5%85%A5/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/JSR303/" rel="tag">JSR303</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/yaml/" rel="tag">yaml</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Spring-Boot运行原理" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/11/19/Spring-Boot%E8%BF%90%E8%A1%8C%E5%8E%9F%E7%90%86/"
    >Spring Boot运行原理</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/11/19/Spring-Boot%E8%BF%90%E8%A1%8C%E5%8E%9F%E7%90%86/" class="article-date">
  <time datetime="2020-11-19T08:50:02.000Z" itemprop="datePublished">2020-11-19</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Spring-Boot/">Spring Boot</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、pom-xml"><a href="#一、pom-xml" class="headerlink" title="一、pom.xml"></a>一、pom.xml</h1><p>Maven项目先得从pom.xml文件探究起</p>
<h2 id="parent父依赖"><a href="#parent父依赖" class="headerlink" title="parent父依赖"></a>parent父依赖</h2><p>在pom.xml中可以看到它主要是依赖于父项目<a href="#">spring-boot-dependencies</a>，这里主要是<strong>管理资源过滤及插件</strong>的，该父项目还包含一个父依赖<a href="#">spring-boot-dependencies</a>，这里才是<strong>真正管理Spring Boot应用里所有依赖版本</strong>的地方，也称<strong>Spring Boot的版本控制中心</strong></p>
<p>以后导入依赖默认不需要写版本，但若导入的包没有在依赖中管理就需要手动配置版本</p>
<h2 id="启动器-Spring-boot-starter"><a href="#启动器-Spring-boot-starter" class="headerlink" title="启动器 Spring-boot-starter"></a>启动器 Spring-boot-starter</h2><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">dependency</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.springframework.boot<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>spring-boot-starter-web<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">dependency</span>&gt;</span></span><br></pre></td></tr></table></figure>

<p>spring-boot-starter-web帮我们导入了web模块正常运行所依赖的组件</p>
<p>Spring Boot将所有的功能场景都抽取出来，封装成一个个启动器，我们只需要在项目中引入这些starter（启动器）即可，所有相关的依赖都会导入进来。如图</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-11-18_19-39-29.jpg" alt=""></p>
      
      <a class="article-more-link" href="/2020/11/19/Spring-Boot%E8%BF%90%E8%A1%8C%E5%8E%9F%E7%90%86/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/SpringBootApplication/" rel="tag">@SpringBootApplication</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Spring-Boot/" rel="tag">Spring Boot</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-初识Spring-Boot" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/11/17/%E5%88%9D%E8%AF%86Spring-Boot/"
    >初识Spring Boot</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/11/17/%E5%88%9D%E8%AF%86Spring-Boot/" class="article-date">
  <time datetime="2020-11-17T05:50:02.000Z" itemprop="datePublished">2020-11-17</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Spring-Boot/">Spring Boot</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="一、什么是Spring-Boot"><a href="#一、什么是Spring-Boot" class="headerlink" title="一、什么是Spring Boot"></a>一、什么是Spring Boot</h2><p>Spring Boot是用来简化Spring应用的初始搭建以及开发过程。该框架可以内嵌Web服务器(tomcat/jetty)，可将开发的web应用不需要作为war包部署到web服务器，而是作为一个可执行程序。Spring Boot专注于快速方便地开发单个个体微服务。</p>
<h2 id="二、Spring-Boot优点"><a href="#二、Spring-Boot优点" class="headerlink" title="二、Spring Boot优点"></a>二、Spring Boot优点</h2><ol>
<li>易上手，提升开发效率，为Spring开发提供一个更简便的体检</li>
<li>避免了繁琐的配置</li>
<li>提供一系列大型项目通用的非业务性功能，如：内嵌服务器、安全管理运行数据监控、运行状况检查等</li>
<li>避免大量的Maven导入和各种版本冲突</li>
</ol>
<h2 id="三、第一个程序-helloSpringBoot"><a href="#三、第一个程序-helloSpringBoot" class="headerlink" title="三、第一个程序:helloSpringBoot"></a>三、第一个程序:helloSpringBoot</h2><h3 id="1-官网构建项目"><a href="#1-官网构建项目" class="headerlink" title="1.  官网构建项目"></a>1.  官网构建项目</h3><p><a href="https://start.spring.io/" target="_blank" rel="noopener">https://start.spring.io/</a></p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-11-16_18-20-15.jpg" alt=""></p>
      
      <a class="article-more-link" href="/2020/11/17/%E5%88%9D%E8%AF%86Spring-Boot/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Spring-Boot/" rel="tag">Spring Boot</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-基于SSM框架的图书管理系统" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/11/16/%E5%9F%BA%E4%BA%8ESSM%E6%A1%86%E6%9E%B6%E7%9A%84%E5%9B%BE%E4%B9%A6%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/"
    >基于SSM框架的图书管理系统</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/11/16/%E5%9F%BA%E4%BA%8ESSM%E6%A1%86%E6%9E%B6%E7%9A%84%E5%9B%BE%E4%B9%A6%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/" class="article-date">
  <time datetime="2020-11-16T14:10:02.000Z" itemprop="datePublished">2020-11-16</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E9%A1%B9%E7%9B%AE/">项目</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、项目展示"><a href="#一、项目展示" class="headerlink" title="一、项目展示"></a>一、项目展示</h1><h2 id="1-访问链接"><a href="#1-访问链接" class="headerlink" title="1.  访问链接"></a>1.  访问链接</h2><p>项目已部署在服务器，点击即可访问</p>
<p><a href="http://42.192.184.23:8080/ssmbuild" target="_blank" rel="noopener">http://42.192.184.23:8080/ssmbuild</a></p>
<ul>
<li>账号    yolin</li>
<li>密码    123456</li>
</ul>
<h2 id="2-登录页"><a href="#2-登录页" class="headerlink" title="2.  登录页"></a>2.  登录页</h2><blockquote>
<p>  使用session对象存储用户登录信息，使用SpringMvc自带拦截器拦截非法请求。Ajax动态监听用户操作，判断用户是否存在于数据库系统并返回消息。</p>
</blockquote>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/2020-11-11.gif" alt=""></p>
<h2 id="3-CRUD"><a href="#3-CRUD" class="headerlink" title="3.CRUD"></a>3.CRUD</h2><blockquote>
<p>  C3P0连接池连接数据库，mybatis操作数据库；搜索采用模糊查询。</p>
</blockquote>
      
      <a class="article-more-link" href="/2020/11/16/%E5%9F%BA%E4%BA%8ESSM%E6%A1%86%E6%9E%B6%E7%9A%84%E5%9B%BE%E4%B9%A6%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/SSM%E6%A1%86%E6%9E%B6%E6%95%B4%E5%90%88/" rel="tag">SSM框架整合</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Jackson与FastJson的使用" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/11/09/Jackson%E4%B8%8EFastJson%E7%9A%84%E4%BD%BF%E7%94%A8/"
    >Jackson与FastJson的使用</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/11/09/Jackson%E4%B8%8EFastJson%E7%9A%84%E4%BD%BF%E7%94%A8/" class="article-date">
  <time datetime="2020-11-08T16:10:02.000Z" itemprop="datePublished">2020-11-09</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Spring-MVC/">Spring MVC</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、Spring遗留问题"><a href="#一、Spring遗留问题" class="headerlink" title="一、Spring遗留问题"></a>一、Spring遗留问题</h1><h2 id="1-通过Spring-MVC来实现转发和重定向"><a href="#1-通过Spring-MVC来实现转发和重定向" class="headerlink" title="1. 通过Spring MVC来实现转发和重定向"></a>1. 通过Spring MVC来实现转发和重定向</h2><ul>
<li>转发：在返回值前面加“forward：”</li>
<li>重定向：在返回值前加“redirect：”</li>
</ul>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-11-08_12-54-22.jpg" alt=""></p>
<h2 id="2-接收请求参数及数据回显"><a href="#2-接收请求参数及数据回显" class="headerlink" title="2. 接收请求参数及数据回显"></a>2. 接收请求参数及数据回显</h2><h3 id="前端接收的是字符串"><a href="#前端接收的是字符串" class="headerlink" title="前端接收的是字符串"></a>前端接收的是字符串</h3>
      
      <a class="article-more-link" href="/2020/11/09/Jackson%E4%B8%8EFastJson%E7%9A%84%E4%BD%BF%E7%94%A8/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/FastJson/" rel="tag">FastJson</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Jackson/" rel="tag">Jackson</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-深入了解Spring-MVC" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/11/08/%E6%B7%B1%E5%85%A5%E4%BA%86%E8%A7%A3Spring-MVC/"
    >深入了解Spring MVC</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/11/08/%E6%B7%B1%E5%85%A5%E4%BA%86%E8%A7%A3Spring-MVC/" class="article-date">
  <time datetime="2020-11-07T16:10:02.000Z" itemprop="datePublished">2020-11-08</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Spring-MVC/">Spring MVC</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、分析Spring-MVC执行流程"><a href="#一、分析Spring-MVC执行流程" class="headerlink" title="一、分析Spring MVC执行流程"></a>一、分析Spring MVC执行流程</h1><ol>
<li>DispatcherServlet表示前置控制器，是整个Spring MVC的控制中心。用户发出请求，DispatcherServlet接收请求并拦截请求</li>
</ol>
<blockquote>
<p>  假设请求的url为：<a href="http://localhost:8080/SpringMVC/hello" target="_blank" rel="noopener">http://localhost:8080/SpringMVC/hello</a></p>
</blockquote>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-11-06_19-44-42.jpg" alt=""></p>
<blockquote>
<p>  该url表示为请求位于服务器localhost:8080上的Spring MVC站点的hello控制器</p>
</blockquote>
<ol start="2">
<li>DispatcherServlet调用HandlerMapping(处理器映射)，根据请求url查找Handler。</li>
<li>HandlerExecution表示具体的Handler，其主要作用是根据url查找控制器，如上的hello</li>
<li>HandlerExecution将解析后的信息传递给DispatcherServlet，如解析控制器映射等</li>
<li>HandlerAdapter表示处理器适配器，其按照特定的规则去执行Handler</li>
<li>Handler让具体的Controller执行</li>
<li>Controller将具体的执行信息返回给HandlerAdapter，如ModelAndView</li>
<li>HandlerAdapter将ModelAndView传递给DispatcherServlet</li>
<li>DispatcherServlet调用视图解析器(ViewResolver)来解析ModelAndView</li>
<li>ViewResolver解析后返回具体View给DispatcherServlet</li>
<li>DispatcherServlet对View进行渲染视图</li>
<li>最终视图呈现给用户</li>
</ol>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/2020-11-0812121.jpg" alt=""></p>
      
      <a class="article-more-link" href="/2020/11/08/%E6%B7%B1%E5%85%A5%E4%BA%86%E8%A7%A3Spring-MVC/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/RestFul%E9%A3%8E%E6%A0%BC/" rel="tag">RestFul风格</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%B3%A8%E8%A7%A3%E5%BC%80%E5%8F%91/" rel="tag">注解开发</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-SpringMVC入门" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/11/04/SpringMVC%E5%85%A5%E9%97%A8/"
    >Spring MVC入门</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/11/04/SpringMVC%E5%85%A5%E9%97%A8/" class="article-date">
  <time datetime="2020-11-04T12:45:02.000Z" itemprop="datePublished">2020-11-04</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Spring-MVC/">Spring MVC</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、回顾MVC"><a href="#一、回顾MVC" class="headerlink" title="一、回顾MVC"></a>一、回顾MVC</h1><p>MVC是<strong>模型、视图、控制器</strong>的简写，是一种软件设计规范。<br>它是将业务逻辑、数据、以显示分离的方式来组织代码。作用是为了<strong>降低视图与业务逻辑间的耦合，利于业务系统的扩展性</strong>。</p>
<blockquote>
<p><strong>MVC：模型(dao,service) 、视图(jsp)、控制器(Servlet)</strong></p>
</blockquote>
<ul>
<li><strong>Model（模型）</strong>：提供要展示的数据，包含数据和行为(数据查询和模型数据状态更新等功能)</li>
<li><strong>View（视图）</strong>：负责进行模型的展示</li>
<li><strong>Controller（控制器）</strong>：接收用户请求，委托给模型进行处理，处理完毕后把返回的数据交给视图来展示。</li>
</ul>
<h1 id="二、回顾servlet"><a href="#二、回顾servlet" class="headerlink" title="二、回顾servlet"></a>二、回顾servlet</h1><h2 id="1-为何要回顾servlet？"><a href="#1-为何要回顾servlet？" class="headerlink" title="1.为何要回顾servlet？"></a>1.为何要回顾servlet？</h2><p><strong>Spring MVC</strong>是基于servlet功能实现的，通过实现Servlet接口的DispatcherServlet来封装其核心功能实现，通过将请求分派给处理程序。</p>
<p>而Servlet可以理解为：<strong>运行在web服务器端的程序，主要功能在于交互式地浏览和修改数据，生成动态Web内容，它是作为中间层介于web浏览器和Http服务器上的数据以及应用程序。</strong></p>
<h2 id="2-Servlet生命周期"><a href="#2-Servlet生命周期" class="headerlink" title="2.Servlet生命周期"></a>2.Servlet生命周期</h2><ol>
<li>被创建：执行<strong>init()</strong>方法初始化Servlet（只执行一次）</li>
<li>提供服务：执行Service()方法，（根据请求方法不同调用<strong>doGet()</strong>或<strong>doPost()</strong>或 其他方法）</li>
<li>被销毁：执行<strong>destory()</strong>方法</li>
</ol>
      
      <a class="article-more-link" href="/2020/11/04/SpringMVC%E5%85%A5%E9%97%A8/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E4%BA%8B%E5%8A%A1/" rel="tag">事务</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Spring事务管理" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/11/03/Spring%E4%BA%8B%E5%8A%A1%E7%AE%A1%E7%90%86/"
    >Spring事务管理</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/11/03/Spring%E4%BA%8B%E5%8A%A1%E7%AE%A1%E7%90%86/" class="article-date">
  <time datetime="2020-11-03T12:45:02.000Z" itemprop="datePublished">2020-11-03</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Spring%E6%A1%86%E6%9E%B6/">Spring框架</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、关于数据库事务"><a href="#一、关于数据库事务" class="headerlink" title="一、关于数据库事务"></a>一、关于数据库事务</h1><p>一个数据库事务可以包含多个查询、修改、删除、插入等数据库动作，它们要么作为一个整体完全得到确认，要么完全失败</p>
<h2 id="四大特性（ACID）："><a href="#四大特性（ACID）：" class="headerlink" title="四大特性（ACID）："></a>四大特性（ACID）：</h2><h4 id="①、原子性（Atomic）"><a href="#①、原子性（Atomic）" class="headerlink" title="①、原子性（Atomic）"></a>①、原子性（Atomic）</h4><p>事务的操作作为整体执行，要么全部执行，要么全部失败</p>
<h4 id="②、一致性（Consistency）"><a href="#②、一致性（Consistency）" class="headerlink" title="②、一致性（Consistency）"></a>②、一致性（Consistency）</h4><p>数据在事务执行之前和执行之后，处于一致状态</p>
<h4 id="③、隔离性（Isolation）"><a href="#③、隔离性（Isolation）" class="headerlink" title="③、隔离性（Isolation）"></a>③、隔离性（Isolation）</h4><p>多个事务之间是隔离的，互不影响</p>
<h4 id="④、持久性（Durability）"><a href="#④、持久性（Durability）" class="headerlink" title="④、持久性（Durability）"></a>④、持久性（Durability）</h4><p>一旦事务提交了，会持久化写到数据库，对数据库的修改是永久性的</p>
      
      <a class="article-more-link" href="/2020/11/03/Spring%E4%BA%8B%E5%8A%A1%E7%AE%A1%E7%90%86/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E4%BA%8B%E5%8A%A1/" rel="tag">事务</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-Spring整合Mybatis" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/11/02/Spring%E6%95%B4%E5%90%88Mybatis/"
    >Spring整合Mybatis</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/11/02/Spring%E6%95%B4%E5%90%88Mybatis/" class="article-date">
  <time datetime="2020-11-02T07:45:02.000Z" itemprop="datePublished">2020-11-02</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/Spring%E6%A1%86%E6%9E%B6/">Spring框架</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、回顾mybatis"><a href="#一、回顾mybatis" class="headerlink" title="一、回顾mybatis"></a>一、回顾mybatis</h1><blockquote>
<p>  <strong>步骤</strong>：</p>
</blockquote>
<ol>
<li>编写实体类</li>
<li>编写核心配置文件</li>
<li>编写接口</li>
<li>编写Mapper.xml</li>
<li>测试</li>
</ol>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-10-31_13-09-49.jpg" alt=""></p>
      
      <a class="article-more-link" href="/2020/11/02/Spring%E6%95%B4%E5%90%88Mybatis/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/MyBatis-Spring/" rel="tag">MyBatis-Spring</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
    <article id="post-斐波那契数列与时间复杂度" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2020/11/01/%E6%96%90%E6%B3%A2%E9%82%A3%E5%A5%91%E6%95%B0%E5%88%97%E4%B8%8E%E6%97%B6%E9%97%B4%E5%A4%8D%E6%9D%82%E5%BA%A6/"
    >斐波那契数列与时间复杂度</a
  >
</h2>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2020/11/01/%E6%96%90%E6%B3%A2%E9%82%A3%E5%A5%91%E6%95%B0%E5%88%97%E4%B8%8E%E6%97%B6%E9%97%B4%E5%A4%8D%E6%9D%82%E5%BA%A6/" class="article-date">
  <time datetime="2020-11-01T10:45:02.000Z" itemprop="datePublished">2020-11-01</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E7%AE%97%E6%B3%95/">算法</a>
  </div>

      
      
      
    </div>
    

    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h1 id="一、斐波那契数列探究"><a href="#一、斐波那契数列探究" class="headerlink" title="一、斐波那契数列探究"></a>一、斐波那契数列探究</h1><h2 id="1-概念"><a href="#1-概念" class="headerlink" title="1. 概念"></a>1. 概念</h2><p><strong>斐波那契数列</strong>（Fibonacci sequence），又称黄金分割数列、因数学家莱昂纳多·斐波那契（Leonardoda Fibonacci）以兔子繁殖为例子而引入，故又称为“兔子数列”，指的是这样一个数列：0、1、1、2、3、5、8、13、21、34、……</p>
<p>在数学上，斐波那契数列以如下被以递推的方法定义：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">F(0)&#x3D;0，F(1)&#x3D;1, F(n)&#x3D;F(n - 1)+F(n - 2)（n ≥ 2，n ∈ N*）</span><br></pre></td></tr></table></figure>

<p>它的起源不论是在数学、生活与自然方面都非常有用，更多关于斐波那契的介绍可参考下面知乎大佬的文章</p>
<p><a href="https://www.zhihu.com/question/28062458" target="_blank" rel="noopener">斐波那契数列在数学和生活中的使用</a></p>
<h2 id="2-代码实现"><a href="#2-代码实现" class="headerlink" title="2. 代码实现"></a>2. 代码实现</h2><p>这道经典算法题被力扣收录为基础题目，其中看了官方的六种解法使我陷入了深深的沉思：</p>
<p>我配学算法么？？？</p>
<p><img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/Snipaste_2020-12-15_17-41-44.jpg" alt="image"></p>
      
      <a class="article-more-link" href="/2020/11/01/%E6%96%90%E6%B3%A2%E9%82%A3%E5%A5%91%E6%95%B0%E5%88%97%E4%B8%8E%E6%97%B6%E9%97%B4%E5%A4%8D%E6%9D%82%E5%BA%A6/">阅读更多...</a>
      
      
      <!-- reward -->
      
    </div>
      <!-- copyright -->
      
    <footer class="article-footer">
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%97%B6%E9%97%B4%E5%A4%8D%E6%9D%82%E5%BA%A6/" rel="tag">时间复杂度</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E7%AE%97%E6%B3%95/" rel="tag">算法</a></li></ul>


    </footer>

  </div>

  

  
  
  

  

</article>
    
  </article>
  

  
  <nav class="page-nav">
    
    <a class="extend prev" rel="prev" href="/">上一页</a><a class="page-number" href="/">1</a><span class="page-number current">2</span><a class="page-number" href="/page/3/">3</a><a class="page-number" href="/page/4/">4</a><span class="space">&hellip;</span><a class="page-number" href="/page/10/">10</a><a class="extend next" rel="next" href="/page/3/">下一页</a>
  </nav>
  
</section>
</div>

      <footer class="footer">
  <div class="outer">
    <ul class="list-inline">
      <li>
        &copy;
        2020-2021
        张金
      </li>
      <li>
        
      </li>
    </ul>
    <ul class="list-inline">
      <li>
        
        
        <span>
  <i>PV:<span id="busuanzi_value_page_pv"></span></i>
  <i>UV:<span id="busuanzi_value_site_uv"></span></i>
</span>
        
      </li>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
        <img src="https://yolin121.oss-cn-beijing.aliyuncs.com/blogimg/beian.png">
        <a href="https://beian.miit.gov.cn"  style="color:#f72b07" target="_blank">陕ICP备20002449号</a>
      </li>

    </ul>
  </div>
</footer>
    <div class="to_top">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>
      </div>
    </main>
      <aside class="sidebar">
        <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="Yolin"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/playlist">歌单</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/video">视频</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/about">关于我</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/friends">友情链接</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
      </aside>
      <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
      
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/jquery.justifiedGallery.min.js"></script>


<script src="/js/lazyload.min.js"></script>


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<script src="/js/share.js"></script>




<script>
  try {
    var typed = new Typed("#subtitle", {
    strings: ['肠断月明红豆蔻,','月似当时,','人似当时否？'],
    startDelay: 1500,
    typeSpeed: 200,
    loop: true,
    backSpeed: 40,
    showCursor: true
    });
  } catch (err) {
  }
  
</script>




<script>
  var ayerConfig = {
    mathjax: true
  }
</script>


<script src="/js/ayer.js"></script>


<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>



<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
      tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
  });

  MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for(i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
      }
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.6/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>


<script type="text/javascript" src="https://js.users.51.la/20544303.js"></script>
  </div>
</body>

</html>